﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpUiPlatformFamily.h"

namespace gfam
{
    struct GCMP_UI_PLATFORM_FAMILY_EXPORT DynamicPanelInfo
    {
        std::wstring cmdId;
        std::wstring cmdName;
        std::wstring cmdIcon;
        std::wstring cmdTooltip;
        DynamicPanelInfo(const std::wstring& cmd, const std::wstring& name, const std::wstring& icon, const std::wstring& tooltip);
    };

    struct GCMP_UI_PLATFORM_FAMILY_EXPORT DynamicPanelInfos
    {
        std::vector<DynamicPanelInfo> panelInfos;
        std::wstring panelCaption;
        std::wstring defaultCmd;
        DynamicPanelInfos(const std::vector<DynamicPanelInfo>& infos, const std::wstring& caption, const std::wstring& defaultCommand);
    };

    class GCMP_UI_PLATFORM_FAMILY_EXPORT DynamicPanelUtils
    {
    public:
        static bool UpdateCreationTypeDynamicPanel(const DynamicPanelInfos& infos);
        static bool UpdateCreationMethodDynamicPanel(const DynamicPanelInfos& infos);
        static bool UpdateCreationConstraintDynamicPanel(const DynamicPanelInfos& infos);

    public:
        static bool AddButtonsIntoDynamicPanel(const DynamicPanelInfos& infos, int dynamicPanelIndex);

        // 主动刷新动态面板
        static bool UpdateDynamicPanel();
    };
}

